package com.cy.pj.sys.dao;

import com.cy.pj.sys.pojo.HouseUser;
import com.cy.pj.sys.pojo.SysUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DaoUser {

    //shiro查询
    @Select("select * from user where username=#{username}")
    SysUser findUserByUsername(String username);

    
    //自己的
    //根据客户username查询客户信息
    List<SysUser> findUserByUserName(String username);

    //基于username更改用户信息
    int updateUser(SysUser sysUser);

    //注册--昵称--姓名--性别--密码--电话
    int insertUsers(SysUser users);

    //登录--昵称--密码

    @Select("select * from user where username=#{username} and password=#{password}")
    SysUser selectUser(String username, String password);

    int updatePassword(
            @Param("password")String password,
            @Param("salt")String salt,
            @Param("id")Integer id);

}
